#ifndef _BGSEGM_H_
#define _BGSEGM_H_

#define CV_WRAP

#include <cxcore.h>
#include <cv.h>

namespace cv
{

	template<typename VT> struct MixData
	{
		float sortKey;
		float weight;
		VT mean;
		VT var;
	};

	class  BackgroundSubtractorMOG 
	{
	public:
		 BackgroundSubtractorMOG();
		virtual ~BackgroundSubtractorMOG();

		virtual void operator()(const Mat& image, Mat& fgmask, Mat& BgImage,const Mat& UpdateMask,double learningRate=0,double learningRateShadow = 0);

		virtual void initialize(Size frameSize, int frameType);

		Size frameSize;
		int frameType;
		Mat bgmodel;
		int nframes;

		//for background
		int history;
		int nmixtures;
		double varThreshold;
		double backgroundRatio;
		double  variance_init;
		double  weight_init;
		double  noiseSigma;

		//for shadow gaussian
		int			iShadowGauss;
		int			iShadowWinSize;
		double	dwShadowThreshold;
		double	dwVarThreshold;
		double  dwWeightInit;
		double  dwVarianceInit;
		double  dwNoiceSigmaInit;

		double  dwBCDThreshold;
	};	

}
#endif